package com.liqi.device.service.impl;

import java.util.List;
import com.liqi.common.utils.DateUtils;
import com.liqi.device.domain.DvDriveSdk;
import com.liqi.device.mapper.DvDriveSdkMapper;
import com.liqi.device.service.IDvDriveSdkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import static com.liqi.common.utils.SecurityUtils.getDeptId;
import static com.liqi.common.utils.SecurityUtils.getUserId;


/**
 * 驱动管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-22
 */
@Service
public class DvDriveSdkServiceImpl implements IDvDriveSdkService
{
    @Autowired
    private DvDriveSdkMapper dvDriveSdkMapper;

    /**
     * 查询驱动管理
     * 
     * @param id 驱动管理主键
     * @return 驱动管理
     */
    @Override
    public DvDriveSdk selectDvDriveSdkById(Long id)
    {
        return dvDriveSdkMapper.selectDvDriveSdkById(id);
    }

    /**
     * 查询驱动管理列表
     * 
     * @param dvDriveSdk 驱动管理
     * @return 驱动管理
     */
    @Override
    public List<DvDriveSdk> selectDvDriveSdkList(DvDriveSdk dvDriveSdk)
    {
        return dvDriveSdkMapper.selectDvDriveSdkList(dvDriveSdk);
    }

    /**
     * 新增驱动管理
     * 
     * @param dvDriveSdk 驱动管理
     * @return 结果
     */
    @Override
    public int insertDvDriveSdk(DvDriveSdk dvDriveSdk)
    {
        dvDriveSdk.setCreateTime(DateUtils.getNowDate());
        dvDriveSdk.setCreateUserId(getUserId().toString());
        dvDriveSdk.setDeptId(getDeptId().toString());
        return dvDriveSdkMapper.insertDvDriveSdk(dvDriveSdk);
    }

    @Override
    public DvDriveSdk selectDvDriveSdkByAdapterName(DvDriveSdk dvDriveSdk) {
        return dvDriveSdkMapper.selectDvDriveSdkByAdapterName(dvDriveSdk);
    }

    @Override
    public DvDriveSdk selectPackageUrl(DvDriveSdk dvDriveSdk) {

        return  dvDriveSdkMapper.selectPackageUrl(dvDriveSdk);
    }

    /**
     * 修改驱动管理
     * 
     * @param dvDriveSdk 驱动管理
     * @return 结果
     */
    @Override
    public int updateDvDriveSdk(DvDriveSdk dvDriveSdk)
    {
        dvDriveSdk.setUpdateTime(DateUtils.getNowDate());
        return dvDriveSdkMapper.updateDvDriveSdk(dvDriveSdk);
    }

    /**
     * 批量删除驱动管理
     * 
     * @param ids 需要删除的驱动管理主键
     * @return 结果
     */
    @Override
    public int deleteDvDriveSdkByIds(Long[] ids)
    {
        return dvDriveSdkMapper.deleteDvDriveSdkByIds(ids);
    }

    /**
     * 删除驱动管理信息
     * 
     * @param id 驱动管理主键
     * @return 结果
     */
    @Override
    public int deleteDvDriveSdkById(Long id)
    {
        return dvDriveSdkMapper.deleteDvDriveSdkById(id);
    }
}
